<template>
	<view class="devicebind">
		<deviceheader :devicedata="devicedetailData"></deviceheader>
		<view class="list">
			<view class="list_item">
				<view class="list_title">激活时间</view><view class="list_text">{{devicedetailData.activate_time}}</view>
			</view>
			<view class="list_item">
				<view class="list_title">设备类型</view><view class="list_text">{{devicedetailData.series_name}}</view>
			</view>
			<view class="list_item">
				<view class="list_title">设备ID</view><view class="list_text">{{devicedetailData.imei}}</view>
			</view>
			<view class="list_item">
				<view class="list_title">开拓BD</view><view class="list_text">{{devicedetailData.realname}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { devicedetail } from '../../api/index.js'
	import deviceheader from '../../components/sevice/deviceheader.vue'
	export default {
		data() {
			return {
				devicedetailData:""
			}
		},
		onLoad:function(data){
			console.log(data.imei);
			this.getDevicedetail(data.imei)
		},
		methods: {
			getDevicedetail:function(imei){
				let that = this;
				devicedetail({
					id:imei
				}).then((res) => {
					console.log(res);
					if(res.code == 0){
						that.devicedetailData = res.data;
						that.devicedetailData.img = res.data.mxeapp_img
					}else{
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				}).catch((e)=>{
					console.log(e);
				})
			}
		},
		components:{
			deviceheader
		}
	}
</script>

<style lang="scss" scoped>
	.devicebind{
		height: 100%;
		background-color: #F5F5F5;
		font-size: $uni-font-size-base;
		color: #666666;
		.top{
			background-color: #007AFF;
			text-align: center;
			margin-bottom: 150rpx;
			position: relative;
			height: 250rpx;
			.top_bg{
				display: flex;
				position: absolute;
				left: 0;right: 0;top: 20rpx;
				width: 100%;
				width: 690rpx;
				height: 335rpx;
				margin: 0 auto;
				background-image: url("../../static/img/ic_qrcodebg2.png");
				background-size: 100% 100%;
				.top_bgimg{
					width: 45%;
					image{
						width: 230rpx;
						height: 230rpx;
						margin-top: 50rpx;
					}
				}
				.top_bgtext{
					margin-left: 20rpx;
					margin-top: 50rpx;
					view{
						padding: 10rpx;
						text-align: left;
					}
				}
			}
		}
		.list{
			background-color: #FFFFFF;
			padding: 0 30rpx;
			.list_item{
				display: flex;
				justify-content: space-between;
				padding: 30rpx 0;
				border-bottom: 1rpx $uni-solid-color solid;
				&:last-child{
					border-bottom: none;
				}
			}
		}
	}
</style>
